package 剑指Offer._0110;

/**
 * 斐波那契数列
 */
public class _10I {

    public int fib(int n) {
        int a = 0, b = 1;
        for (int i = 2; i <= n; i++) {
            int tem = b;
            b = (a + b) % 1000000007;
            a = tem;
        }
        return n == 0 ? a : b;
    }
}
